﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 

using System;
using System.Linq;
using System.Data.Linq.Mapping;
using ManagedServices.DataTransferObjects;

namespace ManagedServices.Persistence
{
    /// <summary>
    /// DataContext class for the Database instance Msf_MetaStore
    /// </summary>
    [global::System.Data.Linq.Mapping.DatabaseAttribute(Name = "Msf_MetaStore")]
    public partial class MetaStoreDataContext : System.Data.Linq.DataContext
    {

        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

        #region Extensibility Method Definitions
        partial void OnCreated();
        partial void InsertDependency(Dependency instance);
        partial void UpdateDependency(Dependency instance);
        partial void DeleteDependency(Dependency instance);
        partial void InsertIdentity(Identity instance);
        partial void UpdateIdentity(Identity instance);
        partial void DeleteIdentity(Identity instance);
        partial void InsertSubscription(Subscription instance);
        partial void UpdateSubscription(Subscription instance);
        partial void DeleteSubscription(Subscription instance);
        partial void InsertSubService(SubService instance);
        partial void UpdateSubService(SubService instance);
        partial void DeleteSubService(SubService instance);
        partial void InsertSubServiceInstance(SubServiceInstance instance);
        partial void UpdateSubServiceInstance(SubServiceInstance instance);
        partial void DeleteSubServiceInstance(SubServiceInstance instance);
        partial void InsertSubServiceRunConfig(SubServiceRunConfig instance);
        partial void UpdateSubServiceRunConfig(SubServiceRunConfig instance);
        partial void DeleteSubServiceRunConfig(SubServiceRunConfig instance);
        #endregion

        
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="connection">connection string</param>
        public MetaStoreDataContext(string connection) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="connection">connection instance</param>
        public MetaStoreDataContext(System.Data.IDbConnection connection) :
            base(connection, mappingSource)
        {
            OnCreated();
        }

        
        /// <summary>
        /// Gets the dependencies
        /// </summary>
        public System.Data.Linq.Table<Dependency> Dependencies
        {
            get
            {
                return this.GetTable<Dependency>();
            }
        }

        /// <summary>
        /// Gets the Identities
        /// </summary>
        public System.Data.Linq.Table<Identity> Identities
        {
            get
            {
                return this.GetTable<Identity>();
            }
        }

        /// <summary>
        /// Gets the Subscriptions
        /// </summary>
        public System.Data.Linq.Table<Subscription> Subscriptions
        {
            get
            {
                return this.GetTable<Subscription>();
            }
        }

        /// <summary>
        /// Gets the SubServices
        /// </summary>
        public System.Data.Linq.Table<SubService> SubServices
        {
            get
            {
                return this.GetTable<SubService>();
            }
        }

        /// <summary>
        /// Gets the running SubServiceInstances
        /// </summary>
        public System.Data.Linq.Table<SubServiceInstance> SubServiceInstances
        {
            get
            {
                return this.GetTable<SubServiceInstance>();
            }
        }

        /// <summary>
        /// Gets the SubServiceRunConfigs
        /// </summary>
        public System.Data.Linq.Table<SubServiceRunConfig> SubServiceRunConfigs
        {
            get
            {
                return this.GetTable<SubServiceRunConfig>();
            }
        }
    }
}
